package com.example.demo.login.loginservice.impl;

import com.example.demo.login.loginbean.TUser;
import com.example.demo.login.loginmapper.TUserMapper;
import com.example.demo.login.loginservice.LoginService;
import com.example.demo.utils.ResultJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: mengxianwei
 * @Date: 2021/01/06/10:07 AM
 * @Description:
 */
@Service
public class LoginServiceImpl implements LoginService {
    @Autowired
    private TUserMapper userMapper;

    @Override
    public ResultJson getLoginInfo(TUser user) {
      TUser user1  =userMapper.selectByPrimaryKey(user.getUserName(),user.getPassword());
        ResultJson resultJson=new ResultJson();
        resultJson.setData(user1);
        return resultJson;
    }

    @Override
    public ResultJson insertLoginInfo(TUser user) {

        ResultJson resultJson=new ResultJson();
        resultJson.setData(userMapper.insert(user));
        return resultJson;
    }
}
